﻿using System.Collections.Concurrent;
using Geek.Server.Core.Actors;
using Geek.Server.Core.Comps;
using Geek.Server.Core.Storage;
using Server.Proto;

namespace Geek.Server.App.Logic.WebServer
{
    public class WebServerState : CacheState
    {
        /// <summary>
        /// 账号信息 key为账号id
        /// </summary>
        public ConcurrentDictionary<long, AccountInfo> AccountMap = new();
        
        /// <summary>
        /// 服务器信息 key为区服id
        /// </summary>
        public ConcurrentDictionary<int, ServerInfo> ServerMap = new();
    }

    [Comp(ActorType.WebServer)]
    public class WebServerComp : StateComp<WebServerState>
    {
        /// <summary>
        /// 账号票据
        /// </summary>
        public Dictionary<long, string> AccountTokenMap = new();
        
        /// <summary>
        /// sdk uid对应的账号id 这里为了方便查询 sdk uid做了拼接
        /// </summary>
        public Dictionary<string, AccountInfo> SDKUidToAccountInfoMap = new();
    }
}